<meta charset="UTF-8">
<h1>f12查看效果</h1>
<script src="./utils1.js"></script>


<h1>日期格式化</h1>
<div id="demo1"></div>
<script>
    var result = ''
result += "dateFormate('2018-5-20 5:20:20') //"+dateFormate('2018-5-20 5:20:20') + "<br/>"
result += "dateFormate('2018-5-20 5:20:20') //"+dateFormate('2018-5-20 5:20:20') + "<br/>"
result += "dateFormate('2018-5-20 5:20:20') //"+dateFormate('2018-5-20 5:20:20') + "<br/>"
result += "dateFormate('2018-5-20 5:20:20') //"+dateFormate('2018-5-20 5:20:20') + "<br/>"
</script>


<h1>快速获取当前时间</h1>
<div id="demo2"></div>
<script>
    var result = ''
result += "format('YmdHIS') //"+format('YmdHis') + "<br/>"
result += "format('Y-m-d H:i:s') //"+format('Y-m-d H:i:s') + "<br/>"
result += "format('Y-m-d') //"+format('Y-m-d') + "<br/>"
document.querySelector('#demo2').innerHTML = result
</script>


<h1>随机颜色</h1>
<div id="demo3"></div>
<script>
    var result = ''
result += "random(colorArr[ Math.floor(Math.random()*(max-min+1)+min) ])//"+random(colorArr[ Math.floor(Math.random()*(max-min+1)+min) ]) + "<br/>"
result += "random(colorArr[ Math.floor(Math.random()*(max-min+1)+min) ])//"+random(colorArr[ Math.floor(Math.random()*(max-min+1)+min) ]) + "<br/>"
result += "random(colorArr[ Math.floor(Math.random()*(max-min+1)+min) ])//"+random(colorArr[ Math.floor(Math.random()*(max-min+1)+min) ]) + "<br/>"
result += "random(colorArr[ Math.floor(Math.random()*(max-min+1)+min) ])//"+random(colorArr[ Math.floor(Math.random()*(max-min+1)+min) ]) + "<br/>"
document.querySelector('#demo3').innerHTML = result
</script>


<h1>判断浏览器内核/pc还是移动/是否是微信浏览器</h1>
<div id="demo4"></div>
<script>
    var result = ''
result += "trident: u.indexOf('Trident') > -1, //"+trident: u.indexOf('Trident') > -1,  + "<br/>"
result += "presto: u.indexOf('Presto')> -1,   //"+presto: u.indexOf('Presto') > -1, + "<br/>"
result += "webKit: u.indexOf('AppleWebKit') > -1,//"+webKit: u.indexOf('AppleWebKit') > -1,+ "<br/>"

</script>



<h1>获取标签样式</h1>
<div id="demo5"></div>
<script>
    var result = ''
result += "getStyleWithKey(width:100px)//" +getStyleWithKey(width:100px)+ "<br/>"
result += "getStyleWithKey(width:200px)//" +getStyleWithKey(width:200px)+ "<br/>"
result += "getStyleWithKey(width:300px)//" +getStyleWithKey(width:300px)+ "<br/>"

document.querySelector('#demo3').innerHTML = result
</script>